<div class="main-title">
	<fly:variable name="title_s" />
</div>
<div id="content_headers">
	<fly:block name="pagination">
		<div id="p_up"  class="pagination"></div>
	</fly:block>
	<fly:block name="description"><div id="description"><fly:variable name='description' /></div></fly:block>
</div>
<fly:include name="pagination_search_sort" />
<div id="content_body">
	<div id="list-gallery">
	<fly:block name="liste">
		<div id="list-photos">
			<fly:list name='list_photo'>
				<div class="b_img" style="height: <fly:variable name='height_out' />px;width: <fly:variable name='width_out' />px;">
					<div id="photo_texte" style="width: <fly:variable name='width8' />px;">
						<a class="imgs" href="/<fly:variable name="url_profil_photo_zoom" />" title="<fly:variable name="des_img" />" rel="group_photo">
							<img title="<fly:variable name='title' />" src="/<fly:variable name='url_profil_photo' />" width="<fly:variable name='width' />" height="<fly:variable name='height' />" />
						</a>
					</div>
					<div class="photo_title"><fly:variable name='titre' /></div>
				</div>
			</fly:list>
		</div>
	</fly:block>
	<fly:block name="aucun">
	</fly:block>
	</div>
</div>
<fly:block name="pagination">
	<div id="p_down" class="pagination"></div>
</fly:block>
<script type="text/javascript">
	
	var items_per_page = <fly:variable name="item_per_page" />;
	var delay_search = <fly:variable name="delay_search" />;
	var num_display_entries = <fly:variable name="num_display_entries" />;
	var id_category_show= <fly:variable name="id_category_show" />;
	var timeout = null;
	var origin_title = null;
	function pageselectCallback(page_id){		
		var limit = (page_id*items_per_page)+" , "+items_per_page;	
	    
	    html_items_list = $.ajax({
	                        url: '<fly:variable name="rep_ajax" /><fly:variable name="rep_item_lister" />',
	                        type: "POST",
	                		data: "limit="+limit+"&id_category_show="+id_category_show,
	                		async: false,
						    complete: function(){
						    	$(".pagination").pagination(<fly:variable name='num_items'/>, {
									items_per_page: items_per_page,
									num_edge_entries:  3,
									num_display_entries:num_display_entries,
									current_page: page_id,
									callback: pageselectCallback
									
								});
						    }
	                    }).responseText;
		html_items_list = eval('html_items_list');
	
		$("#list-gallery").html(html_items_list);
	        
	        //To determine which page we are in
	        jQuery.each($('span.current'), function() {
	        	if($(this).text()==(page_id+1)){
	        		$(this).addClass("cur");	
	        	}
	        });
	};

	$(document).ready(function() {
		$("#list-photos  a.imgs").fancybox({ 'zoomSpeedIn': 1000, 'zoomSpeedOut': 1000});
		     	
		/// Pagination
		var page = <fly:variable name="page" />;	
		if(page > 0){
			current_page = page-1;
		}else{
			current_page = 0;
		}
		///If has only 1 page, no need to show pagination
		//if(<fly:variable name='num_items'/>/items_per_page<=1){$('#pagination-search').hide();}	
		
		$(".pagination").pagination(<fly:variable name='num_items'/>, {
			items_per_page: items_per_page,
			num_edge_entries: 3,
			num_display_entries: num_display_entries,
			current_page: current_page,
			callback: pageselectCallback
			
		});
		
	});
</script>